﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ESXPowerTools.Controller.Objects
{
    /// <summary>
    /// VMInfo- Keeps Info About VM's 
    /// </summary>
    public class VMInfo
    {
        #region Properties

        /// <summary>
        /// Full VM Name , Used to reach for handle when needed.
        /// </summary>
        public string FullName { get; set; }

        /// <summary>
        /// Nice for view name.
        /// </summary>
        public string DisplayName { get; set; }

        

        #endregion

        #region C'Tor

        public VMInfo()
        {

        }

        public VMInfo(string fullName,string displayName)
        {
            this.FullName = fullName;
            this.DisplayName = displayName;
        }

        #endregion

        #region Static Methods

        /// <summary>
        /// Returns New VMInfo object from vm full name
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static VMInfo CreateFromString(string name)
        {
            return new VMInfo()
            {
                FullName = name,
                DisplayName = name.Split('\\').First()
            };

        }


        #endregion
    }
}
